<?php

if(!defined('OI')) {
			
	print '<h1>Access Error</h1>Sorry, this file can not be accessed directly, this is strictly forbidden!';
	exit();
				
}

class pageFooter extends GenericClass {
	
	const LINE_SPLIT = "\n";
	
	/*
	 * Constructor: Trigger parent
	*/
	public function __construct(DigitalUniversity &$digitalUniversity, &$arguments = array()) {
		
		parent::__construct($digitalUniversity, $arguments);
				
		# Clean memory
		unset($digitalUniversity, $arguments);
		
		# Footer contents
		if($this->digitalUniversity->input['page'] != 'login') {
			$this->mainFooterBar();
			$this->closeContainerTags();
		}
		
		$this->footerScripts();
		$this->closePageTags();
				
	}
	
	/*
	 * Destructor: Trigger parent
	*/
	public function __destruct() {
		
		parent::__destruct();
		
	}
	
	private function mainFooterBar() {
		
		# Close page contents
		echo '
		<!-- Content break -->
        <br />
		
	</section>
	<!-- Close pageContents -->';

	}
	
	private function closeContainerTags() {
				
		# Close page container
		echo self::LINE_SPLIT.'</div>
<!-- Close pageContainer -->';

		# Line break
		echo self::LINE_SPLIT;

	}
		
	private function footerScripts() {
			
		$onLoad = $this->digitalUniversity->getJavascriptLoad();
			
echo "<script>
	var rootimg = '{config-img_root}';
	var rooturl = '{config-root_url}';
	".(!empty($onLoad) ? "eval('".implode(';', $onLoad)."');" : "")."
</script>".self::LINE_SPLIT;

	}
		
	private function closePageTags() {
	
echo "</body>
</html>";
		
		
	}
	
}

?>